<template>
  <div class="bus-list page">
    <cube-scroll v-if="items.length>0">
      <div class="list" v-if="items">
        <div class="item" v-for="(item) in items" :key="item.advise.id">
<!--          <div class="line">-->
<!--            <span class="text">申请单号 :</span>-->
<!--            <span class="value">{{item.apply.orderNo}}</span>-->
<!--          </div>-->
          <div class="line">
            <span class="text">标题 : </span>
            <span class="value">{{item.advise.title}}</span>
          </div>
          <div class="line">
            <span class="text">时间 : </span>
            <span class="value">{{parseTime(item.advise.time)}}</span>
          </div>
          <div class="line">
            <span class="text">提交人 :</span>
            <span class="value">{{item.user.name}}  {{item.user.mobile}}</span>
          </div>
          <div class="line" @click="turn(item.advise.id)">
            <span class="text">具体内容 :</span>
            <span class="value" style="color: #ff0000">点击查看</span>
          </div>
          <div class="line">
            <span class="text">状态 :</span>
            <span class="value">{{statusEnum[item.advise.status]}}</span>
          </div>
<!--          <div class="line" v-if="item.apply.status===1">-->
<!--            <span class="text">物流单号 :</span>-->
<!--            <span class="value">{{item.apply.logNo}}</span>-->
<!--          </div>-->
        </div>
      </div>
    </cube-scroll>
    <div class="noData" v-else @click="back()">
      没有数据 点击返回>>
    </div>
  </div>
</template>

<script>
import { parseTime } from '../../../util/time'
import { listAdvise } from '../../../api/apply'
export default {
  created () {
    listAdvise().then(res => {
      this.items = res.data.reverse()
    })
  },
  methods: {
    turn (id) {
      this.$router.push({
        path: '/apply/advise/apply',
        query: {
          id: id
        }
      })
    },
    parseTime (time) {
      return parseTime(time, '{y}.{m}.{d}')
    }
  },
  data () {
    return {
      items: [],
      statusEnum: ['待查阅', '采纳', '未采纳']
    }
  }
}
</script>

<style scoped lang="stylus">
.bus-list
  background-color #F5F4F7
  padding 0 0
  .noData
    dpr-font(14Px)
    color #55545D
    display flex
    align-items center
    justify-content center
    height 100%
  .list
    padding 10px 20px
    .item
      overflow hidden
      margin-top 10px
      padding 20px 20px 0 20px
      background:rgba(255,255,255,1);
      box-shadow:0px 3px 7px 0px rgba(89,88,87,0.52);
      border-radius:10px;
      .line
        display flex
        align-items flex-start
        margin-bottom 20px
        .text,.value
          dpr-font(14Px)
          color #55545D
        .text
          flex 0 0 80px
          margin-right 20px
        .area
          padding 0
          height auto
          color #55545D
          dpr-font(14Px)
          outline none
          border none
      .btns
        display flex
        align-items center
        justify-content space-between
        border-top 1Px solid #F5F4F7
        height 40px
        .btn
          display flex
          align-items center
          justify-content center
          width:80px;
          height:25px;
          background:rgba(89,142,254,1);
          box-shadow:0px 3px 7px 0px rgba(89,88,87,0.52);
          border-radius:10px;
          dpr-font(14px)
          color white
        .no
          background-color #009C4E

</style>
